package cn.edu.ldu.modules.controller;

import cn.edu.ldu.http.rqtUtils;
import cn.edu.ldu.modules.entity.UserAccountEntity;
import cn.edu.ldu.util.Consts;
import com.alibaba.fastjson.JSONObject;

public class UserAccountController {

    public static UserAccountEntity getUserAccount(Long userId, String token) throws Exception {

        JSONObject jsonObject = rqtUtils.httpclientGet(new StringBuffer(Consts.getUserAccount).append("/").append(userId), token);

        if(jsonObject.getString("msg").equals("success"))
            return JSONObject.parseObject(jsonObject.getString("userAccount"), UserAccountEntity.class);

        return null;
    }

}
